import * as util from "@/common/util";
import * as API from "@/api/axios";

export default {

    // 财务概览-平台利润
    getPagePlatformProfit: (params, page) => {
        const url = util.replacePageNumAndSize('/manage/transfers/profit/{pageNum}/{pageSize}', page)
        return API.axiosGetAPI(url, params);
    },
    //财务概览-平台利润-统计
    getTotalPlatformProfit: (params) => {
        return API.axiosGetAPI('/manage/transfers/profit/statistics', params);
    },
    //财务概览-平台利润-导出
    getExportPlatformProfit: (params) => {
        const headers = {'content-Type':'application/x-www-form-urlencoded',
        'lang-key': 'exports' }
        return API.axiosGetAPI(`/manage/excel/export/order-profit?rangeTime=${params.rangeTime}&search=${params.search}&variableTitleHead=${params.variableTitleHead}`, null, headers, {
            responseType: 'blob'
        });
    },

    // 财务概览-伙伴分成
    getPagePartnerBrokerage: (params, page) => {
        const url = util.replacePageNumAndSize('/manage/brokerages/record/{pageNum}/{pageSize}', page)
        return API.axiosGetAPI(url, params);
    },
    //财务概览-伙伴分成-统计
    getTotalPartnerBrokerage: () => {
        return API.axiosGetAPI('/manage/brokerages/partner/summary');
    },
    //财务概览-伙伴分成-导出
    getExportPartnerBrokerage: (params) => {
        const headers = {'content-Type':'application/x-www-form-urlencoded',
        'lang-key': 'exports' }
        return API.axiosPostAPI(`/manage/brokerages/export/partner?target=${params.target}&search=${params.search}&variableTitleHead=${params.variableTitleHead}`, null, headers, {
            responseType: 'blob'
        });
    },

}